Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Illustrator detection as application/pdf instead of application/illustrator #94

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

jeremy
Copy link
Member

@jeremy jeremy commented Sep 13, 2023

Given an .ai file with an application/postscript declared type, the filename extension would be ignored as a potential subtype of the application/pdf magic-byte-detected type.

Fix by evaluating all candidate types rather than a single fallback.

@jeremy jeremy force-pushed the illustrator branch 2 times, most recently from c89579c to 432520b Compare September 13, 2023 04:59
…llustrator

Given an .ai file with an application/postscript declared type, the
filename extension would be ignored as a potential subtype of the
application/pdf magic-byte-detected type.

Fix by evaluating all candidate types rather than a single fallback.
@zzak
Copy link
Member

zzak commented Feb 27, 2024

I just happened to see this today: carrierwaveuploader/carrierwave#2704

@jeremy jeremy merged commit 8080070 into main Feb 28, 2024
19 checks passed
@jeremy jeremy deleted the illustrator branch February 28, 2024 02:22
jeremy added a commit that referenced this pull request Mar 1, 2024
…ension type

The application/octet-stream content type is treated as a default rather
than a specific declaration. We should check the filename extension for
the more specific type in this case. If there's no extension, the type
falls back to binary anyway.

Fixes regression in 1.0.2 -> 1.0.3 introduced by #94.
jeremy added a commit that referenced this pull request Mar 1, 2024
…ension type (#99)

The application/octet-stream content type is treated as a default rather
than a specific declaration. We should check the filename extension for
the more specific type in this case. If there's no extension, the type
falls back to binary anyway.

Fixes regression in 1.0.2 -> 1.0.3 introduced by #94.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants